#Include g:\AHK\git-ahk-lib\util\event\MouseEvent.ahk
#Include G:\AHK\git-ahk-lib\lib\directOverlay\ShinsOverlayClass.ahk

Esc:: ExitApp()

#Include Radio.ahk
#Include RadioGroup.ahk

bx := (A_ScreenWidth - 152) // 2, by := 500, bw := 152, bh := 32
overlay := ShinsOverlayClass(bx, by, bw, bh, 1, 0, 0)

me := MouseEvent(overlay.gui.Hwnd)
me.Register(MouseEvent.Events.LBUTTON_UP, OnLU)
me.Register(MouseEvent.Events.LBUTTON_DOWN, OnLD)

c := '0x000000', c2 := '0x00AAAA', c3 := '0x255e90'
w := 30, h := 30

group := RadioGroup(Rect(31, 1, w * 3, h))
group.AddRadios(
  Radio(Rect(0, 0, w, h), c, c2, c3),
  Radio(Rect(30, 0, w, h), c, c2, c3, 1),
  Radio(Rect(60, 0, w, h), c, c2, c3)
)

Refresh()

DrawBase() {
  overlay.FillRectangle(0, 0, bw, bh, '0xffffffff')
  overlay.DrawRectangle(1, 1, bw - 1, bh - 1, '0xff01ffe1')
}

Refresh() {
  overlay.BeginDraw()
  DrawBase()
  group.draw(overlay)
  overlay.EndDraw()
}

OnLU(point, *) {
  group.OnLU(point)
  Refresh()
}

OnLD(point, *) {
  group.OnLD(point)
  Refresh()
}